const isPhone = (value: string): boolean => {
  return /^1[123456789]\d{9}$/.test(value);
};

const isNumber = val => {
  var regPos = /^\d+(\.\d+)?$/; //非负浮点数
  var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
  if (regPos.test(val) && regNeg.test(val)) {
    return true;
  } else {
    return false;
  }
};

export const CommonRegs = {
  isPhone,
  isNumber
};
